'\" te
.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DDI_INTR_GET_SUPPORTED_TYPES 9F "Apr 07, 2005"
.SH NAME
ddi_intr_get_supported_types \- return information on supported hardware
interrupt types
.SH SYNOPSIS
.nf
#include <sys/types.h>
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>

\fBint\fR \fBddi_intr_get_supported_types\fR(\fBdev_info_t *\fR\fIdip\fR, \fBint *\fR\fItypesp\fR);
.fi

.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI)
.SH PARAMETERS
.ne 2
.na
\fB\fIdip\fR\fR
.ad
.RS 10n
Pointer to \fBdev_info\fR structure
.RE

.sp
.ne 2
.na
\fB\fItypesp\fR\fR
.ad
.RS 10n
Pointer to supported interrupt types
.RE

.SH DESCRIPTION
The \fBddi_intr_get_supported_types()\fR function retrieves the interrupt types
supported by a particular hardware device and by the system software. Upon
successful return, the supported types are returned as a bit mask in the
integer pointed to by the \fItypesp\fR argument. See <\fBsys/ddi_intr.h\fR> for
a list of interrupts that can be returned by a hardware device.
.sp
.LP
For PCI devices that support MSI and/or MSI-X based hardware, this interface
returns only the interrupt types that are supported by all the hardware in the
path to the hardware device.
.sp
.LP
An interrupt type is usable by the hardware device if it is returned by the
\fBddi_intr_get_supported_types()\fR function. The device driver can be
programmed to use one of the returned interrupt types to receive hardware
interrupts.
.SH RETURN VALUES
The \fBddi_intr_get_supported_types()\fR function returns:
.sp
.ne 2
.na
\fB\fBDDI_SUCCESS\fR\fR
.ad
.RS 21n
On success.
.RE

.sp
.ne 2
.na
\fB\fBDDI_EINVAL\fR\fR
.ad
.RS 21n
On encountering invalid input parameters.
.RE

.sp
.ne 2
.na
\fB\fBDDI_INTR_NOTFOUND\fR\fR
.ad
.RS 21n
Returned when the hardware device is found not to support any hardware
interrupts.
.RE

.SH CONTEXT
The \fBddi_intr_get_supported_types()\fR function can be called from user or
kernel non-interrupt context.
.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
.TE

.SH SEE ALSO
.BR pcmcia (4D),
.BR pci (5),
.BR sysbus (5),
.BR attributes (7),
.BR ddi_intr_add_handler (9F),
.BR ddi_intr_alloc (9F),
.BR ddi_intr_enable (9F)
.sp
.LP
\fIWriting Device Drivers\fR
.SH NOTES
The \fBddi_intr_get_supported_types()\fR function can be called by the device
driver even at any time if the driver has added an interrupt handler for a
given interrupt type.
.sp
.LP
Soft interrupts are always usable and are not returned by this interface.
.sp
.LP
Any consumer of this interface should verify that the return value is not equal
to \fBDDI_SUCCESS\fR. Incomplete checking for failure codes could result in
inconsistent behavior among platforms.
